<?php

	/* ====================== SHOPPERPPRESS AMAZON STORE INTEGRATION TOOLS =========================== */

if(isset($_POST['orderid']) && get_option("shopperpress_system") =="amazon-store" ){

	include_once("functions/amazon_api_class.php");	

	$obj = new AmazonProductAPI();

		/* BUILD PRODUCT ASIN DATA */
		$ap =1;
		if(is_array($_SESSION['ddc']['productsincart'])){ foreach($_SESSION['ddc']['productsincart'] as $key => $value) { 
 
			$parameters["Item.".$ap.".ASIN"] 		=  get_post_meta($key, "amazon_guid", true);
			$parameters["Item.".$ap.".Quantity"] 	=  $value;
			 
 			$ap++;
		}}		
 	 
	$parameters["Operation"] 		= "CartCreate";
	$parameters["MergeCart"] 		=  "False";
	$parameters["AssociateTag"] 	=  "AKIAIYZBFKKKHISVQL2Q";
	
 	$result = $obj->CreateCart($parameters);	
 
	header("location: ".$result->Cart->PurchaseURL);
	exit();


}

/*
comment: eway payment code integration
*/
if (isset($_POST['btnProcess'])){
require_once('functions/gateway_eway/_process.php');
}
/*
comment: payment code for iDeal gateway only
*/
if (isset($_POST['bank_id']) and !empty($_POST['bank_id'])) 
{
  require_once('functions/gateway_ideal/ideal.class.php');

  $partner_id  = get_option('ideal_ID');
  $amount      = str_replace(".","",$_POST['amount']);
  $description = $_POST['desc']; 
  $return_url  = 'http://www.domein.nl/callback/'; 
  $report_url  = 'http://www.domein.nl/callback/';	
  $iDEAL = new iDEAL_Payment ($partner_id);

	 if ($iDEAL->createPayment($_POST['bank_id'], $amount, $description, $return_url, $report_url)) {
      header('location: ' . $iDEAL->getBankURL());
	  die();
    }
    else {
      echo 'De betaling kon niet aangemaakt worden.';
    }
}

/*
Template Name: 0. ShopperPress Checkout Page
*/

$wpdb->hide_errors(); nocache_headers();

global $userdata; get_currentuserinfo(); // grabs the user info and puts into vars
 
if($_SESSION['ddc']['price'] > 0 || isset($_GET['hide'])){

$GLOBALS['HIDELAYOUT']=1; 

}elseif(getCartSubtotal($_SESSION['ddc']['productsincart']) !=0){ 

$GLOBALS['HIDELAYOUT']=1; 

}




get_header();

	
	/*
	
	Comment: If the cart is empty
	
	*/	
 
	if(getCartSubtotal($_SESSION['ddc']['productsincart']) ==0){ ?>
    

	<?php if($GLOBALS['shopperpress']['system'] == "credit"){ ?>


	<div style="padding-top:0px;">
	<h2 class="h2top">Purchase Credits</h2><br />

	<?php echo stripslashes(nl2br(get_option("credit_page_text"))); ?>

	<table  id="gradient-style">
	<thead>
    <tr>
        <th scope="col">Package Name</th>
        <th scope="col">Price/Credits</th>            
        <th scope="col"></th>
    </tr>
    </thead>
    <tbody>
		<?php if(get_option('credit_enable_1') == 1){ 
		$p_price = get_option('credit_price_1');
		$p_name = get_option('credit_name_1');
		?>
		  <tr>
			<td style="width:400px; font-size:20px;"><?php echo $p_name; ?></td>
			<td style="width:150px; text-align:left"><?php if($p_price ==0){   }else{ echo $_SESSION['currency_symbol'].$p_price; } ?> for <?php echo get_option('credit_del_1'); ?> Credits</td>			
			<td>
			<div id="BuyButton" class="Btn" style="margin-top:0px; padding-top:0px;">
			<a style="font-size: 14px;" onclick="addProduct('<?php echo get_option("siteurl"); ?>/wp-content/themes/shopperpress/', '', 1, '<?php echo strip_tags($p_name); ?>|ITEM|<?php echo $p_price; ?>|1|na|1','1'); setTimeout('Redirect2Checkout(\'<?php echo get_option("checkout_url"); ?>\')',1250);" href="#"> Add to Cart </a>
			</div>
			</td>
          </tr>			
		<?php } ?>

		<?php if(get_option('credit_enable_2') == 1){ 
		$p_price = get_option('credit_price_2');
		$p_name = get_option('credit_name_2');
		?>
		  <tr>
			<td style="width:400px; font-size:20px;"><?php echo $p_name; ?></td>
			<td style="width:150px; text-align:left"><?php if($p_price ==0){   }else{ echo $_SESSION['currency_symbol'].$p_price; } ?> for <?php echo get_option('credit_del_2'); ?> Credits</td>			
			<td>
			<div id="BuyButton" class="Btn" style="margin-top:0px; padding-top:0px;">
			<a style="font-size: 14px;" onclick="addProduct('<?php echo get_option("siteurl"); ?>/wp-content/themes/shopperpress/', '', 1, '<?php echo strip_tags($p_name); ?>|ITEM|<?php echo $p_price; ?>|2|na|1','1'); Redirect2Checkout('<?php echo get_option("checkout_url"); ?>');" href="#"> Add to Cart </a>
			</div>
			</td>
          </tr>			
		<?php } ?>

		<?php if(get_option('credit_enable_3') == 1){ 
		$p_price = get_option('credit_price_3');
		$p_name = get_option('credit_name_3');
		?>
		  <tr>
			<td style="width:400px; font-size:20px;"><?php echo $p_name; ?></td>
			<td style="width:150px; text-align:left"><?php if($p_price ==0){   }else{ echo $_SESSION['currency_symbol'].$p_price; } ?> for <?php echo get_option('credit_del_3'); ?> Credits</td>			
			<td>
			<div id="BuyButton" class="Btn" style="margin-top:0px; padding-top:0px;">
			<a style="font-size: 14px;" onclick="addProduct('<?php echo get_option("siteurl"); ?>/wp-content/themes/shopperpress/', '', 1, '<?php echo strip_tags($p_name); ?>|ITEM|<?php echo $p_price; ?>|3|na|1','1'); Redirect2Checkout('<?php echo get_option("checkout_url"); ?>');" href="#"> Add to Cart </a>
			</div>
			</td>
          </tr>			
		<?php } ?>
		<?php if(get_option('credit_enable_4') == 1){ 
		$p_price = get_option('credit_price_4');
		$p_name = get_option('credit_name_4');
		?>
		  <tr>
			<td style="width:400px; font-size:20px;"><?php echo $p_name; ?></td>
			<td style="width:150px; text-align:left"><?php if($p_price ==0){   }else{ echo $_SESSION['currency_symbol'].$p_price; } ?> for <?php echo get_option('credit_del_4'); ?> Credits</td>			
			<td>
			<div id="BuyButton" class="Btn" style="margin-top:0px; padding-top:0px;">
			<a style="font-size: 14px;" onclick="addProduct('<?php echo get_option("siteurl"); ?>/wp-content/themes/shopperpress/', '', 1, '<?php echo strip_tags($p_name); ?>|ITEM|<?php echo $p_price; ?>|4|na|1','1'); Redirect2Checkout('<?php echo get_option("checkout_url"); ?>');" href="#"> Add to Cart </a>
			</div>
			</td>
          </tr>			
		<?php } ?>

		<?php if(get_option('credit_enable_5') == 1){ 
		$p_price = get_option('credit_price_5');
		$p_name = get_option('credit_name_5');
		?>
		  <tr>
			<td style="width:400px; font-size:20px;"><?php echo $p_name; ?></td>
			<td style="width:150px; text-align:left"><?php if($p_price ==0){   }else{ echo $_SESSION['currency_symbol'].$p_price; } ?> for <?php echo get_option('credit_del_5'); ?> Credits</td>			
			<td>
			<div id="BuyButton" class="Btn" style="margin-top:0px; padding-top:0px;">
			<a style="font-size: 14px;" onclick="addProduct('<?php echo get_option("siteurl"); ?>/wp-content/themes/shopperpress/', '', 1, '<?php echo strip_tags($p_name); ?>|ITEM|<?php echo $p_price; ?>|5|na|1','1'); Redirect2Checkout('<?php echo get_option("checkout_url"); ?>');" href="#"> Add to Cart </a>
			</div>
			</td>
          </tr>			
		<?php } ?>
		</tbody>
		</table>


	<?php }else{ ?>
	<div style="padding-top:0px;">
	<h2 class="h2top"><?php echo SPEC($GLOBALS['_LANG']['_emptybasket']) ?></h2><br />
    
	<p><?php echo SPEC($GLOBALS['_LANG']['_emptybasketa']) ?></p>
 	<?php } ?>   

	<?php 
	
	
	/*
		
	OK...SO THE BASKET ISNT EMPTY, 
	
	WE MUST HAVE PRODUCTS TO SHOW
	
	*/
	
	}else{

 
	/* ====================== SHOPPERPPRESS SETUP DEFAULT VALUES FOR THE CHECKOUT PAGE =========================== */

	$ShippingCost 			= 0; 
	$ShippingCountryCost 	= 0;
	$TaxAmount				= 0;	
	$ExtraCost				= 0;
	$ExtraTax 				= 0;
	$ExtraDiscount			= 0;
	$TotalWeight			= 0;
	$ENABLE_SHIPPING_COST 	= get_option('shipping_enable');
	$THIS_CHECKOUTLINK 		= get_option("checkout_url"); 
 
	/* ====================== SHOPPERPPRESS CALCULATE PROMOTIONS/COUPONS AND DISCOUNTS =========================== */

		if(isset($_POST['coupon'])){

			check_admin_referer('ShopperPressCoupon');
			$FoundCoupon = ShopperPressCoupon(strip_tags($_POST['coupon'])); 	

		}

		if(isset($FoundCoupon) && is_array($FoundCoupon)){		
		
			if($FoundCoupon['price'] !="" ){  			
				$ExtraDiscount = $FoundCoupon['price']; 			
			}else{ 			
				$ExtraDiscount = ($FoundCoupon['percentage']/100)*getCartSubtotal($_SESSION['ddc']['productsincart']);  			
			} 	

		}


		if(is_array($_SESSION['ddc']['productsincart'])){ foreach($_SESSION['ddc']['productsincart'] as $key => $value) { 

			$ExtraCost += ($_SESSION['ddc'][$key]['extra']*$_SESSION['currency_value'])*$value;
 
		}}		
 
		
		/* ====================== SHOPPERPPRESS CALCULATE THE SHOPPING COSTS =========================== */
 
		if( $ENABLE_SHIPPING_COST == "yes"){

			if(get_option("enable_weightshipping") =="1"){
	
				$TotalWeight = ShippingWeight(); 
	
			}

			if(is_array($_SESSION['ddc']['productsincart'])){ 
				foreach($_SESSION['ddc']['productsincart'] as $key => $value) { 
					if(isset($_SESSION['ddc'][$key]['main_ID'])){
					 $second_key = $_SESSION['ddc'][$key]['main_ID'];
					 $ShippingCost += ($_SESSION['ddc'][$_SESSION['ddc'][$key]['main_ID']]['shipping']*$_SESSION['currency_value'])*$value;
					}else{
					 $second_key =0;
					 $ShippingCost += ($_SESSION['ddc'][$key]['shipping']*$_SESSION['currency_value'])*$value;
					}
				}
			}

			if(isset($_POST['ShippingMethod'])){

				$ShippingCost +=$_POST['ShippingMethod'];
			}
	
			$ShippingCost = ShopperPressShipping(getCartSubtotal($_SESSION['ddc']['productsincart'],2)+$ExtraCost-$ExtraDiscount,$ShippingCost,$TotalWeight);
 
			// COUNTRY BASED SHIPPING
			if(isset($_POST['billing']['country'])){

				if(get_option("shipping_country_fixed_".$_POST['billing']['country']) > 0){

				$ShippingCountryCost  = get_option("shipping_country_fixed_".$_POST['billing']['country']);

				}elseif(get_option("shipping_country_perc_".$_POST['billing']['country']) > 0){ 

				$ShippingCountryCost  = $_POST['price']['total']/100*get_option("shipping_country_perc_".$_POST['billing']['country']);

				}
 
				$ShippingCost += $ShippingCountryCost;
			}
 
		}

		$ShippingSubCost = $ShippingCost;




		/* ====================== SHOPPERPPRESS CALCULATE THE FINAL TAX AMOUNT =========================== */

		if(get_option("checkout_tax_enable") =="yes"){    
    
			$ThisTax = get_option("checkout_tax_amount");			
			$TaxAmount = ShopperPressMoneyFormat(getCartSubtotal($_SESSION['ddc']['productsincart'])/100*$ThisTax);		
 
			if(get_option('checkout_ctax_enable') == "yes"){

				if(isset($_POST['billing']['country'])){ 		
					$ExtraTax = ShopperPressCountryTax($_POST);		
				}
			}

			// include shipping
			if(get_option("enable_shipping_tax") =="1"){
				$TaxAmount = $TaxAmount + ($ShippingCost/100*$ThisTax);
			}		 
		}
		$TaxAmount += $ExtraTax;
		/* ====================== SHOPPERPPRESS PAYMENT TOTALS ARE WORKED OUT HERE =========================== */

		$SHOPPERPRESS_SHIPPING 		= ShopperPressMoneyFormat($ShippingCost);
		$SHOPPERPRESS_SUBTOTAL 		= ShopperPressMoneyFormat(getCartSubtotal($_SESSION['ddc']['productsincart'])+$ExtraCost-$ExtraDiscount);
		$SHOPPERPRESS_PROMOTIONS	= ShopperPressPromotions($_SESSION['ddc']['productsincart'],$SHOPPERPRESS_SUBTOTAL);
		$ExtraDiscount 				+= $SHOPPERPRESS_PROMOTIONS;
		$SHOPPERPRESS_CARTTOTAL 	= ShopperPressMoneyFormat(getCartSubtotal($_SESSION['ddc']['productsincart'])+$ExtraCost-$ExtraDiscount+($ShippingCost+$TaxAmount));
		$CHECKOUT_ORDERID = date("d")."".date("m")."".date("y")."".time()."-".$user_ID;

		/* ====================== SHOPPERPPRESS POST VARS FOR PAYMENT GATEWAY INCLUSION =========================== */

		if(isset($_POST['orderid'])){
		
			include("functions/_paymentgateways.php"); 
			
			$_POST['price']['total'] 	= $SHOPPERPRESS_CARTTOTAL;
			$_POST['price']['shipping'] = $SHOPPERPRESS_SHIPPING;
			
			$OrderDescription = SaveOrder($_POST, true);

		}elseif(get_option("checkout_skip_registration") =="yes"){

			include("functions/_paymentgateways.php"); 

			$_POST['price']['total'] 	= $SHOPPERPRESS_CARTTOTAL;
			$_POST['price']['shipping'] = $SHOPPERPRESS_SHIPPING;
			$_POST['orderid'] 			= $CHECKOUT_ORDERID;

			$OrderDescription = SaveOrder($_POST, true);

		}


 		
		/*
		print "Order ID: ".$CHECKOUT_ORDERID."<br />";
		print "Shipping.".$SHOPPERPRESS_SHIPPING."<br />";
		print "Tax: ".$TaxAmount."<br />";
		print "extra discount: ".$ExtraDiscount."<br />";
		
		
		print "SubTotal: ".$SHOPPERPRESS_SUBTOTAL."<br />";
		print "Total: ".$SHOPPERPRESS_CARTTOTAL;
		*/	 

 

	 ?>
 
     
     <div style="padding:10px;">

<?php if(isset($cartError) && strlen($cartError) > 2){ ?>
<div style="padding:5px; background:red; color:white; font-size:16px;"><?php echo $cartError; ?></div>
<?php } ?>
     
     <div class="clear"></div>
     
     <h2 class="h2top" style="font-size:18px;"><?php echo SPEC($GLOBALS['_LANG']['_checkout']) ?></h2><br />


     
     <table width="960" border="0"><tr><td style="width:650px;" valign="top">
     
 

<?php if(get_option("checkout_skip_registration") !="yes"){ ?>    
     
     <!-- CHECKOUT LOGIN FORM -->
     
     <div id="checkout">     
     <div class="checkout_top">  <?php echo SPEC($GLOBALS['_LANG']['_213e']) ?></div>
     <div class="checkout_inner" <?php if ( $user_ID ) : ?> style="display:none;"<?php endif; ?> <?php if(isset($_POST['orderid'])){ ?> style="display:none;"<?php } ?> id="checkout_step1">
     
     <table width="100%" border="0" class="checkout_table"><tr><td style="border-right:1px dotted #666; padding-right:10px; width:300px;" valign="top">
        
        <h2><?php echo SPEC($GLOBALS['_LANG']['_213f']) ?></h2><hr />
        
		<form class="loginform" action="<?php bloginfo('wpurl'); ?>/wp-login.php" method="post" id="loginform">
		<input name="redirect_to" type="hidden" value="<?php echo get_option("checkout_url"); ?>" />

		<p>
			<label for="user_login"><?php echo SPEC($GLOBALS['_LANG']['_username']); ?>:</label>
			<input name="log"  class="mid" id="user_login" type="text" />
			<br/>
			<label for="user_pass"><?php echo SPEC($GLOBALS['_LANG']['_password']); ?>:</label>
			<input name="pwd" class="mid" id="user_pass" type="password" />
			<br/>
		</p>
		
		<div >
			<input name="rememberme" class="checkbox" id="rememberme" value="forever" type="checkbox" checked="checked"/>
			<label for="rememberme"><?php echo SPEC($GLOBALS['_LANG']['_remember']); ?></label>
			
		<p class="submit">

  
        <input name="" type="submit" value="<?php echo SPEC($GLOBALS['_LANG']['_checkout_line22']) ?>" class="CheckoutBtn"  />
			<input type="hidden" name="testcookie" value="1" />
		</p>
		</div>
	</form>
        
         
      
        </td><td></td><td valign="top">
        
        <h2><?php echo SPEC($GLOBALS['_LANG']['_213g']) ?></h2><hr />
        <p><?php echo SPEC($GLOBALS['_LANG']['_213h']) ?></p>
        <p><?php echo SPEC($GLOBALS['_LANG']['_213i']) ?></p>
        
        
        <p class="CheckoutBtn" style="float:left; margin-right:50px;">
        	<a href="<?php echo get_option('home'); ?>/wp-login.php?action=register">
				<?php echo SPEC($GLOBALS['_LANG']['_checkout_line21']) ?>
             </a>
        </p>
        
        <div class="clear"></div>
        
        <?php if(get_option("checkout_display_guest") =="yes"){  ?>
        
        <h2><?php echo SPEC($GLOBALS['_LANG']['_213j']) ?></h2><hr />
        <p><?php echo SPEC($GLOBALS['_LANG']['_213k']) ?></p>
 
        
         <p class="CheckoutBtn"  style="float:left; margin-right:50px;">
         	<a href="#" onClick="toggleLayer('checkout_step2');toggleLayer('checkout_step1')">
            	<?php echo SPEC($GLOBALS['_LANG']['_213l']) ?>
             </a>
         </p> 
         
         <?php } ?>          
                     
        </td>
      </tr>
    </table>

     
     </div>
     
     
     
     
     
     <!--
	
	<input type="text" name="price[shipping]"  value="<?php echo $SHOPPERPRESS_SHIPPING; ?>" />
	<input type="text" name="price[total]" id="shippingcost" value="<?php echo $SHOPPERPRESS_SUBTOTAL; ?>" />
	<input type="hidden" name="billing[cus_id]" value="<?php echo $userdata->ID ?>" >

-->
     
     
     
     
     <!-- DELIVERY INFORMATION -->
     
    <form action="<?php echo $THIS_CHECKOUTLINK; ?>" method="post" name="formcheck" onSubmit="return formCheck(this);">    
	<input type="hidden" name="page_url" value="<?php echo selfURL(); ?>" />
 	<input type="hidden" name="currentship" id="curentshippingcost" value="<?php if(get_option('pak_enable_1') == 1){ echo get_option('pak_price_1'); }else{ print "0"; } ?>" />
	<input type="hidden" name="orderid" value="<?php echo $CHECKOUT_ORDERID; ?>" />
	<input type="hidden" name="price[total]" value="<?php echo $SHOPPERPRESS_CARTTOTAL; ?>" />
    <?php if(isset($FoundCoupon) && is_array($FoundCoupon)){ ?>
    <?php wp_nonce_field('ShopperPressCoupon') ?>
    <input type="hidden" name="coupon" value="<?php echo $FoundCoupon['name']; ?>" />    
    <?php } ?>
   
     
     <div class="checkout_top">  <?php echo SPEC($GLOBALS['_LANG']['_checkout_line9']) ?></div>
     <div class="checkout_inner" <?php if(!isset($_POST['orderid'])){ if ( $user_ID ){ ?> style="display:visible" <?php }else{ ?>style="display:none;"<?php } } ?>
     <?php if(isset($_POST['orderid'])){ ?>style="display:none;"<?php } ?> id="checkout_step2">
     
     <h2 class="h2top"><?php echo SPEC($GLOBALS['_LANG']['_checkout_line9']) ?></h2>
	 <p><?php echo SPEC($GLOBALS['_LANG']['_checkout_line10']) ?></p><br />


   
        <div class="row"><label class="col1"><?php echo SPEC($GLOBALS['_LANG']['_checkout_line11']) ?></label>
        <span class="col2"><input type="text" name="billing[fname]" class="mid2" size="35" maxlength="100" value="<?php echo $userdata->first_name ?>"/></span>
        </div>

        <div class="row"><label class="col1"><?php echo SPEC($GLOBALS['_LANG']['_checkout_line12']) ?></label>
        <span class="col2"><input type="text" name="billing[lname]" class="mid2" size="35" maxlength="100" value="<?php echo $userdata->last_name ?>"/></span>
        </div>
        
        <div class="row"><label class="col1">Email </label>
        <span class="col2"><input type="text" name="billing[email]" class="mid2" size="35" maxlength="100" value="<?php echo $userdata->user_email; ?>"/></span>
        </div>
        
        <div class="row">
        <label class="col1"><?php echo SPEC($GLOBALS['_LANG']['_checkout_line13']) ?></label>
        <span class="col2"><input type="text" name="billing[address1]" class="mid2" size="35" maxlength="100"/></span>
        </div>
        
        <div class="row">
        <label class="col1"> </label>
        <span class="col2"><input type="text" name="billing[address2]" class="mid2" size="35" maxlength="100"/></span>
        </div>

        <div class="row">
        <label class="col1"><?php echo SPEC($GLOBALS['_LANG']['_checkout_line15']) ?></label>
        <span class="col2"><input type="text" name="billing[city]" class="mid2" size="35" maxlength="100"/></span>
        </div>
        
        <div class="row">
        <label class="col1"><?php echo SPEC($GLOBALS['_LANG']['_checkout_line17']) ?></label>
        <span class="col2"><input type="text" name="billing[zip]" class="mid2" size="35" maxlength="100"/></span>
        </div>


        <div class="row">
        <label class="col1"><?php echo SPEC($GLOBALS['_LANG']['_checkout_line16']) ?></label>
        <span class="col2">
        <select name="billing[country]" class="mid2" onChange="ShopperPress_ChangeState(this.value)">
    <option value="United Kingdom"> ----------------- </option>     
<option value="United Kingdom">United Kingdom</option> 
<option value="United States of America">United States of America</option> 
<option value="Afghanistan">Afghanistan</option> 
<option value="Albania">Albania</option> 
<option value="Algeria">Algeria</option> 
<option value="American Samoa">American Samoa</option> 
<option value="Andorra">Andorra</option> 
<option value="Angola">Angola</option> 
<option value="Anguilla">Anguilla</option> 
<option value="Antarctica">Antarctica</option> 
<option value="Antigua and Barbuda">Antigua and Barbuda</option> 
<option value="Argentina">Argentina</option> 
<option value="Armenia">Armenia</option> 
<option value="Aruba">Aruba</option> 
<option value="Australia">Australia</option> 
<option value="Austria">Austria</option> 
<option value="Azerbaijan">Azerbaijan</option> 
<option value="Bahamas, The">Bahamas, The</option> 
<option value="Bahrain">Bahrain</option> 
<option value="Bangladesh">Bangladesh</option> 
<option value="Barbados">Barbados</option> 
<option value="Belarus">Belarus</option> 
<option value="Belgium">Belgium</option> 
<option value="Belize">Belize</option> 
<option value="Benin">Benin</option> 
<option value="Bermuda">Bermuda</option> 
<option value="Bhutan">Bhutan</option> 
<option value="Bolivia">Bolivia</option> 
<option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option> 
<option value="Botswana">Botswana</option> 
<option value="Bouvet Island">Bouvet Island</option> 
 
<option value="Brazil">Brazil</option> 
<option value="British Indian Ocean Territory">British Indian Ocean Territory</option> 
<option value="British Virgin Islands">British Virgin Islands</option> 
<option value="Brunei">Brunei</option> 
<option value="Bulgaria">Bulgaria</option> 
<option value="Burkina Faso">Burkina Faso</option> 
<option value="Burundi">Burundi</option> 
<option value="Cambodia">Cambodia</option> 
<option value="Cameroon">Cameroon</option> 
 
<option value="Canada">Canada</option> 
<option value="Canary Islands">Canary Islands</option> 
<option value="Cape Verde">Cape Verde</option> 
<option value="Cayman Islands">Cayman Islands</option> 
<option value="Central African Republic">Central African Republic</option> 
<option value="Chad">Chad</option> 
<option value="Chile">Chile</option> 
<option value="China">China</option> 
<option value="Christmas Island">Christmas Island</option> 
 
<option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option> 
<option value="Colombia">Colombia</option> 
<option value="Comoros">Comoros</option> 
<option value="Congo">Congo</option> 
<option value="Cook Islands">Cook Islands</option> 
<option value="Costa Rica">Costa Rica</option> 
<option value="Croatia">Croatia</option> 
<option value="Cuba">Cuba</option> 
<option value="Cyprus">Cyprus</option> 
 
<option value="Czech Republic">Czech Republic</option> 
<option value="Democratic Republic of the Congo">Democratic Republic of the Congo</option> 
<option value="Denmark">Denmark</option> 
<option value="Djibouti">Djibouti</option> 
<option value="Dominica">Dominica</option> 
<option value="Dominican Republic">Dominican Republic</option> 
<option value="East Timor">East Timor</option> 
<option value="Ecuador">Ecuador</option> 
<option value="Egypt">Egypt</option> 
 
<option value="El Salvador">El Salvador</option> 
<option value="Equatorial Guinea">Equatorial Guinea</option> 
<option value="Eritrea">Eritrea</option> 
<option value="Estonia">Estonia</option> 
<option value="Ethiopia">Ethiopia</option> 
<option value="Falkland Islands (Malvinas)" >Falkland Islands (Malvinas)</option> 
<option value="Faroe Islands">Faroe Islands</option> 
<option value="Fiji">Fiji</option> 
<option value="Finland">Finland</option> 
 
<option value="France">France</option> 
<option value="French Guiana">French Guiana</option> 
<option value="French Polynesia">French Polynesia</option> 
<option value="French Southern/Antarctic Lands">French Southern/Antarctic Lands</option> 
<option value="Gabon">Gabon</option> 
<option value="Gambia">Gambia</option> 
<option value="Georgia">Georgia</option> 
<option value="Germany">Germany</option> 
<option value="Ghana">Ghana</option> 
 
<option value="Gibraltar">Gibraltar</option> 
<option value="Greece">Greece</option> 
<option value="Greenland">Greenland</option> 
<option value="Grenada">Grenada</option> 
<option value="Guadeloupe">Guadeloupe</option> 
<option value="Guam">Guam</option> 
<option value="Guatemala">Guatemala</option> 
<option value="Guinea">Guinea</option> 
<option value="Guinea-Bissau">Guinea-Bissau</option> 
 
<option value="Guyana">Guyana</option> 
<option value="Haiti">Haiti</option> 
<option value="Heard and McDonald Islands">Heard and McDonald Islands</option> 
<option value="Honduras">Honduras</option> 
<option value="Hong Kong">Hong Kong</option> 
<option value="Hungary">Hungary</option> 
<option value="Iceland">Iceland</option> 
<option value="India">India</option> 
<option value="Indonesia">Indonesia</option> 
 
<option value="Iraq">Iraq</option> 
<option value="Ireland">Ireland</option> 
<option value="Islamic Republic of Iran">Islamic Republic of Iran</option> 
<option value="Israel">Israel</option> 
<option value="Italy">Italy</option> 
<option value="Ivory Coast">Ivory Coast</option> 
<option value="Jamaica">Jamaica</option> 
<option value="Japan">Japan</option> 
<option value="Jordan">Jordan</option> 
 
<option value="Kazakhstan">Kazakhstan</option> 
<option value="Kenya">Kenya</option> 
<option value="Kiribati">Kiribati</option> 
<option value="Korea, South">Korea, South</option> 
<option value="Kuwait">Kuwait</option> 
<option value="Kyrgyzstan">Kyrgyzstan</option> 
<option value="Lao Peoples Democratic Republic">Lao Peoples Democratic Republic</option> 
<option value="Latvia">Latvia</option> 
<option value="Lebanon">Lebanon</option> 
 
<option value="Lesotho">Lesotho</option> 
<option value="Liberia" >Liberia</option> 
<option value="Libya">Libya</option> 
<option value="Liechtenstein">Liechtenstein</option> 
<option value="Lithuania">Lithuania</option> 
<option value="Luxembourg">Luxembourg</option> 
<option value="Macau">Macau</option> 
<option value="Macedonia">Macedonia</option> 
<option value="Madagascar">Madagascar</option> 
 
<option value="Malawi">Malawi</option> 
<option value="Malaysia">Malaysia</option> 
<option value="Maldives">Maldives</option> 
<option value="Mali">Mali</option> 
<option value="Malta">Malta</option> 
<option value="Man, Isle of">Man, Isle of</option> 
<option value="Marshall Islands">Marshall Islands</option> 
<option value="Martinique">Martinique</option> 
<option value="Mauritania">Mauritania</option> 
 
<option value="Mauritius" >Mauritius</option> 
<option value="Mayotte">Mayotte</option> 
<option value="Mexico">Mexico</option> 
<option value="Micronesia">Micronesia</option> 
<option value="Moldova, Republic of">Moldova, Republic of</option> 
<option value="Monaco">Monaco</option> 
<option value="Mongolia">Mongolia</option> 
<option value="Monserrat">Monserrat</option> 
<option value="Morocco">Morocco</option> 
 
<option value="Mozambique">Mozambique</option> 
<option value="Namibia">Namibia</option> 
<option value="Nauru">Nauru</option> 
<option value="Nepal">Nepal</option> 
<option value="Netherlands">Netherlands</option> 
<option value="Netherlands Antilles">Netherlands Antilles</option> 
<option value="New Caledonia">New Caledonia</option> 
<option value="New Zealand">New Zealand</option> 
<option value="Nicaragua">Nicaragua</option> 
 
<option value="Niger">Niger</option> 
<option value="Nigeria">Nigeria</option> 
<option value="Niue">Niue</option> 
<option value="Norfolk Island">Norfolk Island</option> 
<option value="Northern Mariana Islands">Northern Mariana Islands</option> 
<option value="Norway">Norway</option> 
<option value="Oman">Oman</option> 
<option value="Pakistan">Pakistan</option> 
<option value="Palau">Palau</option> 
 
<option value="Panama">Panama</option> 
<option value="Papua New Guinea">Papua New Guinea</option> 
<option value="Paraguay">Paraguay</option> 
<option value="Peru">Peru</option> 
<option value="Philippines">Philippines</option> 
<option value="Pitcairn">Pitcairn</option> 
<option value="Poland">Poland</option> 
<option value="Portugal">Portugal</option> 
<option value="Puerto Rico">Puerto Rico</option> 
 
<option value="Qatar">Qatar</option> 
<option value="Reunion">Reunion</option> 
<option value="Romania">Romania</option> 
<option value="Russia">Russia</option> 
<option value="Rwanda">Rwanda</option> 
<option value="Saint Lucia">Saint Lucia</option> 
<option value="Samoa">Samoa</option> 
<option value="San Marino">San Marino</option> 
<option value="Sao Tome and Principe">Sao Tome and Principe</option> 
 
<option value="Saudi Arabia">Saudi Arabia</option> 
<option value="Scotland">Scotland</option> 
<option value="Senegal">Senegal</option> 
<option value="Seychelles">Seychelles</option> 
<option value="Sierra Leone">Sierra Leone</option> 
<option value="Singapore">Singapore</option> 
<option value="Slovakia">Slovakia</option> 
<option value="Slovenia">Slovenia</option> 
<option value="Solomon Islands">Solomon Islands</option> 
<option value="Somalia">Somalia</option> 
 
<option value="South Africa">South Africa</option> 
<option value="South Georgia/Sandwich Islands">South Georgia/Sandwich Islands</option> 
<option value="Spain">Spain</option> 
<option value="Sri Lanka">Sri Lanka</option> 
<option value="St. Helena">St. Helena</option> 
<option value="St. Kitts and Nevis">St. Kitts and Nevis</option> 
<option value="St. Pierre and Miquelon">St. Pierre and Miquelon</option> 
<option value="St. Vincent and the Grenadines">St. Vincent and the Grenadines</option> 
<option value="Sudan">Sudan</option> 
<option value="Suriname">Suriname</option> 
<option value="Svalbard/Jan Mayen Islands">Svalbard/Jan Mayen Islands</option> 
<option value="Swaziland">Swaziland</option> 
<option value="Sweden">Sweden</option> 
<option value="Switzerland">Switzerland</option> 
<option value="Syria">Syria</option> 
<option value="Taiwan">Taiwan</option> 
<option value="Tajikistan">Tajikistan</option> 
<option value="Tanzania, United Republic of">Tanzania, United Republic of</option> 
 
<option value="Thailand">Thailand</option> 
<option value="Togo">Togo</option> 
<option value="Tokelau">Tokelau</option> 
<option value="Tonga">Tonga</option> 
<option value="Trinidad and Tobago">Trinidad and Tobago</option> 
<option value="Tunisia">Tunisia</option> 
<option value="Turkey">Turkey</option> 
<option value="Turkmenistan">Turkmenistan</option> 
<option value="Turks and Caicos Islands">Turks and Caicos Islands</option> 
 
<option value="Tuvalu">Tuvalu</option> 
<option value="U.S. Minor Outlying Islands">U.S. Minor Outlying Islands</option> 
<option value="Uganda">Uganda</option> 
<option value="Ukraine">Ukraine</option> 
<option value="United Arab Emirates">United Arab Emirates</option> 
<option value="Uruguay">Uruguay</option> 
<option value="Uzbekistan">Uzbekistan</option> 
 
<option value="Vanuatu">Vanuatu</option> 
<option value="Vatican City State (Holy See)">Vatican City State (Holy See)</option> 
<option value="Venezuela">Venezuela</option> 
<option value="Vietnam">Vietnam</option> 
<option value="Virgin Islands">Virgin Islands</option> 
<option value="Wallis and Futuna Islands">Wallis and Futuna Islands</option> 
<option value="Western Sahara">Western Sahara</option> 
<option value="Yemen">Yemen</option> 
<option value="Zambia">Zambia</option> 
<option value="Zimbabwe">Zimbabwe</option> 
        </select></span>
        </div>
        
        
        <div id="ShopperPressState"></div><!-- AJAX STATE LIST -->
 
        
        
        <div class="row">
        <label class="col1"><?php echo SPEC($GLOBALS['_LANG']['_checkout_line14']) ?></label>
        <span class="col2"><input type="text" name="billing[phone]" class="mid2" size="35" maxlength="100"/></span>
        </div>

        <br /><br /><div class="clear"></div>
        <h2 class="h2top"><?php echo SPEC($GLOBALS['_LANG']['_213c']); ?></h2>
        <p><?php echo SPEC($GLOBALS['_LANG']['_213d']); ?></p>
        <br/>
        
        <div class="row">
        <label for="user_login"></label>
        <span><textarea   name="billing[comments]" style="width:400px; height:60px;"></textarea></span>
        </div>
       


        <div class="clear"></div>
        
        <?php if(get_option("shipping_enable") =="yes" && ( get_option('pak_enable_1') == 1 || get_option('pak_enable_1') == 2 || get_option('pak_enable_1') == 3 || get_option('pak_enable_1') == 4   ) ){ ?>
        
         <p class="CheckoutBtn"><a href="#" onClick="toggleLayer('checkout_step3');toggleLayer('checkout_step2')"><?php echo SPEC($GLOBALS['_LANG']['_checkout_line20']) ?></a></p>
         
         <?php }else{ ?>
         
         <p class="CheckoutBtn"><input name="" type="submit" value="<?php echo SPEC($GLOBALS['_LANG']['_checkout_line20']) ?>"></p>
         
         
         <?php } ?>
        
   
     
     
     </div>
     
     
     
     
     
     
     
     
     
     <!-- SHIPPING METHODS --> 
     
     <?php if(get_option("shipping_enable") =="yes"){ ?>
     
     <div class="checkout_top"><?php echo SPEC($GLOBALS['_LANG']['_213m']) ?></div>
     <div class="checkout_inner" style="display:none;" id="checkout_step3">
     
     <h2 class="h2top"><?php echo SPEC($GLOBALS['_LANG']['_213n']) ?></h2>
     
     
     
     <?php if($ShippingCost ==0 && $ShippingSubCost > 0){ ?>
			 
			 <br /><?php echo SPEC($GLOBALS['_LANG']['_freeship']) ?> 
	
	<?php }else{ ?>
     
     <p><?php echo SPEC($GLOBALS['_LANG']['_213o']) ?></p>  
    
    	<table width="100%"  border="0" style="background-color:#DFFFE8">
		<?php if(get_option('pak_enable_1') == 1){ 
		$p_price = get_option('pak_price_1');
		?>
		  <tr>
			<td style="width:50px;height:30px;"> <input name="ShippingMethod" type="radio" value="<?php echo $p_price; ?>" onChange="UpdateShippingCost(<?php echo $p_price; ?>)" checked="checked"></td>
			<td style="width:150px; text-align:left"><?php if($p_price ==0){   }else{ echo $_SESSION['currency_symbol'].get_option('pak_price_1'); } ?></td>
			<td><?php echo get_option('pak_name_1'); ?></td>
		  	<td><?php echo get_option('pak_del_1'); ?></td>
          </tr>
			<tr><td colspan="4" style="background-color:#ccc;height:1px;"></td></tr>
		<?php } ?>
		<?php if(get_option('pak_enable_2') == 1){ 
		$p_price = get_option('pak_price_2');
		?>
		  <tr>
			<td style="width:50px;height:30px;"> <input name="ShippingMethod" type="radio" value="<?php echo $p_price; ?>" onChange="UpdateShippingCost(<?php echo $p_price; ?>)"></td>
			<td><?php if($p_price ==0){  }else{ echo $_SESSION['currency_symbol'].get_option('pak_price_2'); } ?></td>
			<td><?php echo get_option('pak_name_2'); ?></td>
            <td><?php echo get_option('pak_del_2'); ?></td>
		  </tr>
			<tr><td colspan="4" style="background-color:#ccc;height:1px;"></td></tr>
		<?php } ?>
		<?php if(get_option('pak_enable_3') == 1){ 
		$p_price = get_option('pak_price_3');
		?>
		  <tr>
			<td style="width:50px;height:30px;"> <input name="ShippingMethod" type="radio" value="<?php echo $p_price; ?>" onChange="UpdateShippingCost(<?php echo $p_price; ?>)"></td>
			<td><?php if($p_price ==0){   }else{ echo $_SESSION['currency_symbol'].get_option('pak_price_3'); } ?></td>
			<td><?php echo get_option('pak_name_3'); ?></td>
            <td><?php echo get_option('pak_del_3'); ?></td>
		  </tr>
			<tr><td colspan="4" style="background-color:#ccc;height:1px;"></td></tr>
		<?php } ?>
		<?php if(get_option('pak_enable_4') == 1){ 
		$p_price = get_option('pak_price_4');
		?>
		  <tr>
			<td style="width:50px;height:30px;"> <input name="ShippingMethod" type="radio" value="<?php echo $p_price; ?>" onChange="UpdateShippingCost(<?php echo $p_price; ?>)"></td>
			<td><?php if($p_price ==0){   }else{ echo $_SESSION['currency_symbol'].get_option('pak_price_4'); } ?></td>
			<td><?php echo get_option('pak_name_4'); ?></td>
            <td><?php echo get_option('pak_del_4'); ?></td>
		  </tr>
			<tr><td colspan="4" style="background-color:#ccc;height:1px;"></td></tr>
		<?php } ?>
		<?php if(get_option('pak_enable_5') == 1){ 
		$p_price = get_option('pak_price_5');
		?>
		  <tr>
			<td style="width:50px;height:30px;"> <input name="ShippingMethod" type="radio" value="<?php echo $p_price*$_SESSION['currency_value']; ?>" onChange="UpdateShippingCost(<?php echo $p_price*$_SESSION['currency_value']; ?>)"></td>
			<td><?php if($p_price ==0){  }else{ echo $_SESSION['currency_symbol'].get_option('pak_price_5')*$_SESSION['currency_value']; } ?></td>
			<td><?php echo get_option('pak_name_5'); ?></td>
            <td><?php echo get_option('pak_del_5'); ?></td>
		  </tr>
			<tr><td colspan="4" style="background-color:#ccc;height:1px;"></td></tr>
		<?php } ?>
		</table>
        
        <?php } ?>
        
         <p class="CheckoutBtn"><input name="" type="submit" value="<?php echo SPEC($GLOBALS['_LANG']['_checkout_line20']) ?>"></p>
         
         <p ><a href="#" onClick="toggleLayer('checkout_step3');toggleLayer('checkout_step2')"><?php echo SPEC($GLOBALS['_LANG']['_213r']) ?></a></p>
 
           
     
     </div>
     
     
     <?php } ?>
     
     
 </form>     
     
     
     
     
     
<?php } ?>     
     
     
     
     
     <!-- PAYMENT METHODS -->
     

     <div class="checkout_top"><?php echo SPEC($GLOBALS['_LANG']['_213s']) ?></div>
     <div class="checkout_inner" <?php if(isset($_POST['orderid'])){ ?>style="display:visible;"<?php }else{ ?>style="display:none;"<?php } ?> id="checkout_step4">
     
 	<h2 class="h2top"><?php echo SPEC($GLOBALS['_LANG']['_checkout_line2']) ?></h2>

	<p><?php echo SPEC($GLOBALS['_LANG']['_checkout_line3']) ?></p>	

	<p><b><?php echo SPEC($GLOBALS['_LANG']['_checkout_line4']) ?> <?php echo $_POST['orderid']; ?></b></p>

 	<?php if($ShippingCountryCost > 0){ ?>
    
    	<p><?php echo SPEC($GLOBALS['_LANG']['_213p']) ?> <?php print $_POST['billing']['country'];  ?> <?php echo SPEC($GLOBALS['_LANG']['_213q']) ?> <?php print $_SESSION['currency_symbol'].$ShippingCountryCost; ?></p>

	<?php } ?>
        
    <p><?php echo SPEC($GLOBALS['_LANG']['_213t']) ?> <?php print $_SESSION['currency_symbol'].ShopperPressMoneyFormat($_POST['price']['total']); ?></p>
        
        <?php if(isset($ExtraTax) && $ExtraTax > 0){ ?>
        
        <p>Additional Country/State Tax Added: <?php echo $_SESSION['currency_symbol'].$ExtraTax; ?></p>
        
        <?php } ?>

		<?php if(get_option("checkout_setup") =="email"){ ?>
    
        	<?php echo stripslashes(get_option("checkout_email_text")); ?>
    
        <?php }else{ ?>

			<p><?php echo SPEC($GLOBALS['_LANG']['_checkout_line5']) ?></p>
 
            <table cellpadding="0" cellspacing="0" class="select notoppadding" style="padding:0px; margin:0px; margin-top:20px; ">
            
            <?php

        
            $_POST['description'] = "Cart Order ID: ".$_POST['orderid'];
            
            $i=1;
			if(is_array($gatway)){
            foreach($gatway as $Value){
            if(get_option($Value['function']) =="yes"){
  
			if( $Value['function'] != "gateway_paypalpro" && $Value['function'] != "gateway_ewayAPI"){            
            ?>     
            
            <tr style="height:60px; background:#eee; border-bottom:1px solid #cccccc;">
            <td width="80"><?php if(strlen(get_option($Value['function']."_icon")) > 5){ echo "<img src='".get_option($Value['function']."_icon")."' />"; } ?></td>
            <td width="434">&nbsp;&nbsp;<b><?php echo get_option($Value['function']."_name"); ?></b></td>
            <td width="123"><?php echo $Value['function']($_POST); ?></td>
            </tr>
            <tr><td colspan="3"><hr></td></tr>
            
            <?php 

			}else{
			echo "<tr><td colspan=3>";
			echo $Value['function']($_POST);
			echo "</td></tr><td colspan=3><hr></td></tr>";		
			}


			} } }  ?>
            </table>
            
    <?php } ?>
     
     </div>
     
     
     </div>
     
     
     
     
     </td><td valign="top">
     
 
     <div class="checkout_basket_top"><?php echo SPEC($GLOBALS['_LANG']['_213u']) ?></div>
     <div class="checkout_basket">
     
     
     	<?php 
 		 
		if(is_array($_SESSION['ddc']['productsincart'])){ 

		foreach($_SESSION['ddc']['productsincart'] as $key => $value) { 

			if(isset($_SESSION['ddc'][$key]['main_ID'])){
				 $key = $_SESSION['ddc'][$key]['main_ID'];					 
			} 

		$item['qty'] 	= get_post_meta($key, "qty", true);
		$Item_ShippingCost = ($_SESSION['ddc'][$key]['shipping']*$_SESSION['currency_value'])*$value;

		?>

        
        <div id="ddcproductCheckoutt<?php echo $key; ?>" class="basket_item" style="background:white; border-bottom: 1px dashed #efefef;">

		<?php if($GLOBALS['shopperpress']['system'] =="credit"){ ?>

				<img src="<?php echo bloginfo('template_url'); ?>/images/coin.jpg" style="float:left; margin-right:10px; margin-left:10px; padding-bottom:80px;" align="absmiddle" />
				<h2>Download Credits</h2>

		<?php }else{ ?>
        
				<img src="<?php echo SPImage(getProductImg($key,$second_key)); ?>" width="40" height="35" style="float:left; margin-right:10px; padding-bottom:80px;" />
				
				<b><?php echo getProductName($key,$second_key) ?></b>
				
				<?php if(isset($_SESSION['ddc'][$key]['size']) && $_SESSION['ddc'][$key]['size'] !="na"){ ?>
				<p><em><?php echo get_option('custom_field1'); ?>: <?php echo $_SESSION['ddc'][$key]['size']; ?></em></p>
				<?php } ?>
		
				<?php if(isset($_SESSION['ddc'][$key]['color']) && $_SESSION['ddc'][$key]['color'] !="na"){ ?>
				<p><em><?php echo get_option('custom_field2'); ?>: <?php echo $_SESSION['ddc'][$key]['color']; ?></em></p>
				<?php } ?>
		
				<?php if(isset($_SESSION['ddc'][$key]['extra']) && $_SESSION['ddc'][$key]['extra'] !=0){ ?>
				<p><em><?php echo get_option('custom_field3'); ?>: <?php echo $_SESSION['currency_symbol'].$_SESSION['ddc'][$key]['extra']; ?></em></p>
				<?php } ?>
		
				<?php if($ENABLE_SHIPPING_COST == "yes"){ if(isset($_SESSION['ddc'][$key]['shipping']) && $_SESSION['ddc'][$key]['shipping'] !="na" && $_SESSION['ddc'][$key]['shipping'] !="0" && $ShippingCost > 0){ ?>
				<p><em><?php echo SPEC($GLOBALS['_LANG']['_shippingcost']) ?>: <?php echo $_SESSION['currency_symbol'].$_SESSION['ddc'][$key]['shipping']; ?></em></p>
				<?php } } ?>
				 
				 <p>
				 
					Qty: <span id="CheckoutQty<?php echo $key ?>"><?php echo $value; ?></span> 
					
					<?php echo SPEC($GLOBALS['_LANG']['_total']) ?>: 
					
					<?php echo $_SESSION['currency_symbol']; ?>
					
					<span class="Price"><?php echo ShopperPressMoneyFormat(getProductPrice($key,$second_key)*$value); ?></span>
					
				 </p> 
		
				
				<p <?php if(isset($_POST['orderid'])){ ?> style="display:none;"<?php } ?>>        
				
				<a href="#" onClick="removeProduct(<?php echo $key ?>,<?php echo $Item_ShippingCost ?>); setTimeout(CheckoutAlert('Would you like to update your basket now?', '<?php echo $THIS_CHECKOUTLINK; ?>'),80000);">
					<img src="<?php echo bloginfo('template_url'); ?>/images/basket_delete.gif" align="absmiddle">
					<?php echo SPEC($GLOBALS['_LANG']['_removeitem']) ?>
				</a> 
		
				<?php if($value < $item['qty']){ ?>
		
				<a href="#" onClick="increaseQty(<?php echo $key ?>,<?php echo $Item_ShippingCost ?>,<?php echo $item['qty'] ?>); setTimeout(CheckoutAlert('Would you like to update your basket now?', '<?php echo $THIS_CHECKOUTLINK; ?>'),80000);">
					<img src="<?php echo bloginfo('template_url'); ?>/images/add.gif" align="absmiddle">
						<?php echo SPEC($GLOBALS['_LANG']['_increaseqty']) ?>
				</a>
		
				<?php } ?>
				</p>
        
 		<?php } ?>
        <?php if(isset($_SESSION['ddc']['productsincart'])){ echo displayProducts($_SESSION['ddc']['productsincart']); } // DO NOT REMOVED ?>


        </div>
        <div class="clear"></div>
        
        <?php } } ?>
     
     
     </div>
     <div style="height:25px; background:#f1f1f1; font-size:12px; border:1px solid #dddddd; border-top:0px; padding:5px;">
     

    <div style="width:310px; margin-left:20px; padding-top:0px;">    

        
        <div style="float:left; width:190px;  margin-top:5px;">
        
          <a href="index.php?emptyCart=1"><?php echo SPEC($GLOBALS['_LANG']['_emptybasket']) ?></a>
            
        </div>
        
         <div style="float:left; width:120px;  margin-top:5px; text-align:right;">
        
           <a href="javascript:location.reload(true);"><?php echo SPEC($GLOBALS['_LANG']['_updatebasket']) ?></a>
        
        </div>
    
    </div>
     
     </div>
     
     <div class="clear"></div>
     
     <?php if(get_option("coupon_enable") =="yes"){  ?>
     
     <div class="couponbar">	
	
	<form name="couponCode" method="POST">
	<?php wp_nonce_field('ShopperPressCoupon') ?>
	<table width="100%"  border="0"><tr><td>
    
        <b><?php echo SPEC($GLOBALS['_LANG']['_entercoupon']) ?></b> 
        <input name="coupon" type="text" style="height:20px; font-size:16px; border:1px solid #666; width:150px; margin-left:50px; margin-right:10px;"> 
        <a href="#" onClick="document.couponCode.submit();">
        	<img src="<?php echo bloginfo('template_url') ?>/images/add.gif" align="absmiddle" style="margin-top:-7px;"/>
        </a>
        
     </td></tr></table>
	</form>
	 
     </div> <div class="clear"></div>
     <?php } ?>
     
     
    
    
     
     <div style="text-align:right; margin-top:10px;">
     	<small>
        	<?php echo SPEC($GLOBALS['_LANG']['_213v']) ?> <strong id="cartqty"><?php echo $_SESSION['ddc']['cartqty']; ?></strong>
        </small>
     </div>
     
   
   
    <div style="background:#f2f9db; text-align:right; padding:15px; width:280px; margin-left:40px;">
       
   	<ul class="checkout_totals">
    
		<li class="subtotal">
			<span><?php echo SPEC($GLOBALS['_LANG']['_subtotal']) ?>:</span>
			<strong><?php echo $_SESSION['currency_symbol']; ?>
            	<b id="CheckoutSubTotal"><?php echo ShopperPressMoneyFormat($SHOPPERPRESS_SUBTOTAL,1); ?></b>
            </strong>
		</li>
 
       <?php if( $TotalWeight > 0){	 ?>
       
       	<li>
			<span><?php echo SPEC($GLOBALS['_LANG']['_213a']); ?>:</span>
			<strong>Weight <?php echo ShopperPressMoneyFormat($TotalWeight); ?></strong>
		</li>

	  <?php } ?>  
      



	<?php if($ENABLE_SHIPPING_COST =="yes"){  ?>
        
       	<li>
			<span><?php echo SPEC($GLOBALS['_LANG']['_shippingcost']) ?>:</span>
			<strong>  
		 
			<?php if($SHOPPERPRESS_SHIPPING ==0 && get_option("shipping_free") =="yes" ){ ?>
                 <?php echo SPEC($GLOBALS['_LANG']['_freeship']) ?> 
            <?php }else{ ?>
                 <?php echo $_SESSION['currency_symbol'].$SHOPPERPRESS_SHIPPING; ?> 
            <?php } ?>
			</strong>
		</li>
        
	<?php } ?>



	<?php if($SHOPPERPRESS_PROMOTIONS > 0){ ?>

		<li>
			<span>Promotion Discount</span>
			<strong>-<?php echo $_SESSION['currency_symbol']; ?> <?php echo ShopperPressMoneyFormat($SHOPPERPRESS_PROMOTIONS); ?></strong>
		</li>

	<?php } ?>  
      
      
      <?php if(get_option("checkout_tax_enable") =="yes"){  ?>
 
       	<li>
			<span><?php echo SPEC($GLOBALS['_LANG']['_213b']); ?> <?php if(!isset($ExtraTax) && $ThisTax > 0){ ?><em>(<?php echo $ThisTax; ?>%):</em><?php } ?></span>
			<strong><?php echo $_SESSION['currency_symbol']; ?> <?php echo ShopperPressMoneyFormat($TaxAmount); ?></strong>
		</li>
        
	<?php } ?>   
        
        
        
  	<?php if(isset($FoundCoupon) && is_array($FoundCoupon)){ 	?>
    
		<li>
			<span><?php echo SPEC($GLOBALS['_LANG']['_coupondis']) ?>:</span>
         
         <strong>   
		<?php 
		
		if($FoundCoupon['price'] !="" ){   
		
		echo $_SESSION['currency_symbol'].$FoundCoupon['price'];  
		
		}else{ 
		
		echo "%".$FoundCoupon['percentage'];   
		
		} ?>	
        
        </strong>
		</li>
        
	<?php } ?>             
		
 
	</ul>
  
  	<div class="clear"></div>  
  
     </div>
 

     
     <div style="margin-top:10px; font-size:21px; text-align:right">
     
     	<?php echo SPEC($GLOBALS['_LANG']['_total']); ?>: 
        
        <strong style="color:red;"><?php echo $_SESSION['currency_symbol']; ?>
             
     	<span id="CheckoutTotal"><?php	echo ShopperPressMoneyFormat($SHOPPERPRESS_CARTTOTAL,1); ?></span>
         
        </strong>
        
     </div>
     
     
     
     <div class="clear"></div><br />     
  
     
     </td></tr></table><br />
     
   

	<?php  }  ?>
	
    </div> 
    
    <?php get_footer(); ?>